<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
            width: 400px;
            height: 400px;
            background-color: #cbea31;
            /* 内边距 */
            /* 上下左右都为30px距离 */
            padding: 30px;
        }
        .d1{
            width: 200px;
            height: 200px;
            background-color: #477eff;
            /* 顺时针设置：上右下左 */
            padding:40px 30px 50px;
            /* 内减模式 */
            box-sizing: border-box;
        }
        .d2{
            width: 50px;
            height: 50px;
            background-color: #ff60a2;
        }
    </style>
</head>
<body>
    <!-- 内边距：盒子边缘与内容之间距离 -->
    <div class="box">
        <div class="d1">
            <div class="d2"></div>
        </div>
    </div>
</body>
</html>